﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace YueRu.Common.Encrypt
{
    public static class HashEncrypt
    {
        public static string SHA256Hash(string input)
        {
            byte[] InputBytes = Encoding.Default.GetBytes(input);

            SHA256Managed sha256 = new SHA256Managed();
            byte[] OutputBytes = sha256.ComputeHash(InputBytes);

            return Convert.ToBase64String(OutputBytes);
        }
    }
}